DLsite Organizer v3.0
=====================
Automatically organises your DLsite game folders by fetching metadata
from DLsite, preserving your Directory Opus Rating and Tags.


REQUIREMENTS
------------
- Windows 10 or 11
- Python 3.10+         https://www.python.org/downloads/
- Directory Opus 13+   (for metadata preservation)

Run install_requirements.bat once to install the two Python packages:
  - tkinterdnd2   drag and drop support
  - Pillow        cover image preview


HOW IT WORKS
------------
1. You set an Output Root folder — this is where organised games go.
   Your original folders are NEVER moved or modified.

2. You add game folders to the Queue by dragging and dropping them
   onto the Drop zone, or clicking + Add.

3. Click Run. For each folder the following steps happen:

   [Check if organised]
   Scans the output root to see if this game is already there.
   If found, it skips silently — nothing is overwritten.

   [Get product ID]
   Looks for an RJ/VJ/BJ number in the folder name (e.g. RJ01549139).
   If none is found, it searches DLsite automatically using the folder
   name as a search query.

   [Scrape DLsite]
   Fetches the product page at dlsite.com/maniax and extracts:
     - Japanese title
     - Circle / author name
     - Cover image URL
   Then sends the Japanese title to Google Translate (free, no API key)
   to get an English title for the folder name.

   [DOpus copy]
   Uses dopusrt.exe (Directory Opus command line tool) to copy your
   original folder into the output root with the COPYSECURITY flag.
   This preserves all Directory Opus metadata including Rating and Tags.
   The copy is given a temporary name during this step.

   [Rename to English title]
   Renames the copied folder to the English game title.
   Because this is a rename (not a new folder), Directory Opus keeps
   the Rating and Tags attached to it.

   [Rename to RJ ID]
   Creates a fresh subfolder named after the RJ ID inside the English
   title folder, then moves all game files into it.
   The RJ ID subfolder has no rating or tags — clean slate.

   [Download cover]
   Downloads the cover image from DLsite and saves it in the English
   title folder as:  - Japanese Title.jpg

   [Write comment]
   Writes the circle/author name as a Comment on the English title
   folder via desktop.ini so Directory Opus displays it in the
   Comments column.


FINAL STRUCTURE
---------------
Output Root/
  Let's become lovers with.../    <- English title  (Rating + Tags preserved)
    - 常識改変しみゅれーたー.jpg    <- Cover image
    RJ01549139/                   <- RJ ID subfolder (game files here)
      game files...


CHECKLIST (bottom right)
------------------------
While a folder is being processed, the checklist shows each step with:
  ○  pending
  ⟳  currently running
  ✓  completed successfully
  ✗  failed

The cover image preview updates as soon as the scrape step fetches
the cover URL from DLsite.


QUEUE AND STATUS (top panels)
------------------------------
Queue  — shows the folders waiting to be processed.
Status — shows the result of each folder after processing.
Clicking a row in either panel highlights the matching row in the other.


TIPS
----
- Folder names with the RJ ID process faster (skips the search step).
  e.g. "RJ01549139" or "RJ01549139 - My Game Name" both work.

- If a folder name has no RJ ID, the tool searches DLsite using the
  full folder name. Special characters like ♡ are handled automatically
  by trying progressively shorter search queries until results are found.

- If the tool picks the wrong game, rename your folder to include the
  correct RJ ID and run again.

- Running the same folder twice is safe — the already-organised check
  at the start will detect it and skip without doing anything.

- Any leftover "ph eng" folders in the output root (from a failed
  previous run) are automatically cleaned up before starting.


NETWORK REQUESTS
----------------
The tool makes requests to:
  dlsite.com          - scraping game info
  translate.googleapis.com  - free Google Translate (no key needed)
  img.dlsite.jp       - downloading cover images

No personal data is sent. No accounts or API keys are required.
